package com.pengcheng.taskapplication.mvp.view.activity;

import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.media.Image;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.pengcheng.taskapplication.R;
import com.pengcheng.taskapplication.contants.ConstantValue;
import com.pengcheng.taskapplication.model.SubscribeOrderModel;
import com.pengcheng.taskapplication.mvp.presenter.UserPresenter;
import com.pengcheng.taskapplication.net.IView;
import com.pengcheng.taskapplication.util.ToastUtils;

import java.io.IOException;

import butterknife.BindView;
import butterknife.OnClick;
import okhttp3.ResponseBody;

/**
 * Created by ZFT on 2020/10/28.
 */

public class PaySuccessActivity extends BaseActivity implements IView{

    @BindView(R.id.tv_center_title)
    TextView tv_center_title;
    @BindView(R.id.img_show)
    ImageView img_show;
    //private String type;


    @Override
    protected int layoutResID() {
        return R.layout.activity_pay_success_layout;
    }

    @Override
    protected void initData() {
        tv_center_title.setText("支付完成");
        img_show.setVisibility(View.GONE);
        //type= getIntent().getStringExtra("type");
    }


    @Override
    public void onSuccess(String code, String msg, Object data, String actionType) {

        if(actionType.equals(ConstantValue.RequestKey.cancelapply)){
            ToastUtils.showShortToast(msg);
            PaySuccessActivity.this.finish();
        }

    }

    @Override
    public void onFailed(String code, String msg) {

    }

    @OnClick({R.id.img_back,R.id.ll_confirm})
    public void onViewClicked(View view) {
        Intent intent;
        switch (view.getId()) {
            case R.id.img_back:
                finish();
                break;
            case R.id.ll_confirm:
                //支付成功点击确认,进入列表页面，或者取消
//                if(type.equals("wash")){
//                    intent=new Intent(context,MyWashList.class);
//                    startActivity(intent);
//                    PaySuccessActivity.this.finish();
//                }else if(type.equals("park")){
//                    intent=new Intent(context,MyParkList.class);
//                    startActivity(intent);
//                    PaySuccessActivity.this.finish();
//                }
                PaySuccessActivity.this.finish();
                break;
        }
    }



}
